package com.wjjun.viewmodel;

import android.databinding.ObservableField;

import com.wjjun.basemvpvm.viewmodel.BaseViewModel;

/**
 * 定义不同的状态
 * Created by 42524 on 2017/11/1.
 */

public class StateViewModel extends BaseViewModel {

    //数据为空时
    public final ObservableField<String> emptyText = new ObservableField<>();
    public final ObservableField<Integer> emptyImg = new ObservableField<>(0);

    //没有网络
    public final ObservableField<String> notNetText = new ObservableField<>();
    public final ObservableField<Integer> notNetImg = new ObservableField<>(0);

    //网络错误
    public final ObservableField<String> netErrorText = new ObservableField<>();
    public final ObservableField<Integer> netErrorImg = new ObservableField<>(0);

    //加载中
    public final ObservableField<String> loadingText = new ObservableField<>();


    public void setEmptyText(String text) {
        this.emptyText.set(text);
    }

    public String getEmptyText() {
        return emptyText.get();
    }

    public void setEmptyImg(int id) {
        emptyImg.set(id);
    }

    public int getEmptyImg() {
        return emptyImg.get();
    }

    public void setNotNetText(String text) {
        notNetText.set(text);
    }

    public String getNotNetText() {
        return notNetText.get();
    }

    public void setNotNetImg(int resId) {
        notNetImg.set(resId);
    }

    public int getNotNetImg() {
        return notNetImg.get();
    }

    public void setNetErrorText(String text) {
        netErrorText.set(text);
    }

    public String getNetErrorText() {
        return netErrorText.get();
    }

    public void setNetErrorImg(int resId) {
        netErrorImg.set(resId);
    }

    public int getNetErrorImg() {
        return netErrorImg.get();
    }

    public void setLoadingText(String text) {
        loadingText.set(text);
    }

    public String getLoadingText() {
        return loadingText.get();
    }
}
